import React from 'react'
import UserTitle from '../../component/usertitle/usertitle';
import PanelBar from '../../component/panelbar/panelbar';

class UserInfo extends React.Component {

    state = {
        loading : false,
        data:'你大爷'
    }

    PanelBarChange=(e)=>{
        this.setState({loading:true})
        setTimeout(()=>{
            this.setState({loading:false, data:Math.random()*10000})
        }, 1000)
    }

    render() {
        const bars = [{
            title:'文章',
            icon:<i className="iconfont icon-wenzhang-copy" />
        },{
            title:'动态',
            icon:<i className="iconfont icon-iconlingdang" />
        },{
            title:'最新评论',
            icon:<i className="iconfont icon-pingluncomment43" />
        },{
            title:'热门',
            icon:<i className="iconfont icon-remen" />
        },]
        return (
            <div>
                <UserTitle />

                <PanelBar bars={bars} loading={this.state.loading} onChange={this.PanelBarChange}>
                    <div>
                        <h1>{this.state.data}</h1>
                    </div>
                </PanelBar>
            </div>
        )
    }
}

export default UserInfo